home *** CD-ROM | disk | FTP | other *** search
/ MacSilverWare / macsilverware.iso / Control Panels / PwrSwitcher / PwrSwitcher Instructions < prev   
Text File  |  1993-06-02  |  19KB  |  205 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. PwrSwitcher is a System 7 control panel that lets you change from one active application to another using your keyboard instead of the Finder’s application menu.
  10.  
  11.  
  12.  
  13.  
  14. PwrSwitcher 1.1 is the first new version since November 1991. There are a lot of changes…
  15.  
  16. 1) I’ve found a better fix for the Illustrator and Excel glitches, without need for the Control key hack of version 1.0. (I added a checkbox for those who actually got to like adding the Control key to the activation chords; you can choose behavior identical to either the 1.0 or the 1.0 NC version.)
  17. 2) There is now a checkbox to specify choice of power key or ‘esc’ key, rather than trying to decide based on keyboard type Gestalt information. This means that this version should works fine on PowerBooks if you select ‘esc’ as the activation key.
  18. 3) Settings changes are now effective without first closing the control panel.
  19. 4) I removed the “notify if can’t switch” feature. No one liked it, myself included…
  20. 5) PwrSwitcher won’t “queue up” a switch if there’s a modal dialog as the front window.
  21. 6) The control panel now shows you the actual activation chords you need to use, based on the settings of the options. Before, you had to decipher them from some rather cryptic descriptions.
  22. 7) I fixed two crashes: one would occur if you pressed the power key after PwrSwitcher had loaded, but before the Finder had started; the other happened if you started your Mac with extensions disabled and then opened and closed the PwrSwitcher control panel.
  23. 8) You may have noticed that PwrSwitcher 1.0 “forgot” how to skip hidden applications if you’ve updated to System 7.1 — this has been fixed.
  24. 9) A new chord, shift-command-option-escape, lets you enter the debugger. The control key is never required, even if you’ve selected “require controls” for the other chords. I added this so I didn’t have to keep both PwrSwitcher and Programmer’s Key (I’m an extensions minimalist…). I’ve noticed that this doesn’t work on a Color Classic; I suspect a similar problem exists on other new machines. On these, you have the built-in command-power chord to break into the debugger. Also, note that the debugger is assumed to support _DebugStr!
  25. 10) I’ve added a stack space check; PwrSwitcher will not do anything unless there is at least 1K of free space on the stack, as determined by _StackSpace. This should avoid crashes with some other extensions that hog stack space, at the expense of occasionally ignoring a switch request.
  26. 11) I’ve added documentation that enables hackers to customize PwrSwitcher’s activation chords.
  27.  
  28.  
  29.  
  30.  
  31. What do you need to use PwrSwitcher? System 7, enough memory so you can run more than one application, and the right keyboard. Using the control panel, you can configure PwrSwitcher to use the Power key on a keyboard so equipped, or the ‘esc’ key on a Portable or PowerBook.
  32.  
  33.  
  34.  
  35.  
  36. How do you install PwrSwitcher? Drag the PwrSwitcher icon to your System Folder and let the Finder put it into the Control Panels folder. Then restart your Macintosh.
  37.  
  38.  
  39.  
  40.  
  41. PwrSwitcher will be in your Control Panels folder. Most people can get to their control panels from the Apple menu, like this:
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. When you double–click on the PwrSwitcher icon, you’ll see a summary of PwrSwitcher keystrokes. Remember this so you don’t have to keep coming back to these instructions.
  57.  
  58. The control panel has balloon help and and several checkboxes that allow you to customize PwrSwitcher to your tastes — at least within the realm of the settings provided by the checkboxes. Settings are saved in a file called PwrSwitcher Prefs in the Preferences folder. The checkboxes will be dimmed if you haven’t yet booted your machine with PwrSwitcher installed.
  59.  
  60. The description I’ll give assumes that the “Auto-show hidden applications” box is unchecked in the the PwrSwitcher control panel.
  61.  
  62. How does PwrSwitcher work? I’ll show you with an example. Let’s assume I’ve opened these applications in the following order: Finder (opened by System 7 at startup), DarkSide, MPW Shell, MORE 3.0, THINK Pascal, TeachText, and MacDraw. Also assume that I’ve hidden DarkSide. At this point, the Finder’s application menu looks like this:
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. Notice that there is a check mark next to Finder — this is the “current” application. The current application’s windows are in front of all other windows, and its menus are in the menu bar.
  80.  
  81. In the following description, I’ll describe activation “chords” (a group of keys to be pressed together) for PwrSwitcher. Using the PwrSwitcher control panel, you can decide for yourself whether to use the Power key (the unmarked key with the sideways triangle embossed in its surface) or the ‘esc’ key, and whether to require the Control key as part of every chord. In order to keep the descriptions from becoming tedious, I’ll use a standard form of the activation chords in the remaining description — I’ll assume that the activation key is the Power key and that the Control key is not required.
  82.  
  83. If you are using a Portable or a PowerBook, you don’t have a Power key as found on the larger keyboards, so you would have to configure PwrSwitcher’s control panel to specify the ‘esc’ key as the activation key. When you read about a chord that uses Power in the description, you’d actually use the ‘esc’ key.
  84.  
  85. One more point. None of the chord descriptions in this document include the Control key. The Control key is required in all chords if you check the ‘Require Control key to activate function’ checkbox. If unchecked, you don’t need to use the Control key (although you can). If you are using PwrSwitcher for the first time, this checkbox will be turned off.
  86.  
  87. Each time I press Power, the current application changes: MPW Shell the first time, then MORE 3.0, THINK Pascal after that, then TeachText, and finally MacDraw. The next time I press Power, the Finder becomes current once again. The applications became current in the same order they were opened.
  88.  
  89. You may have noticed that DarkSide never became the current application as I repeatedly cycled using Power. That’s because DarkSide is hidden, and PwrSwitcher never makes a hidden application visible.
  90.  
  91. Now let’s suppose I make the Finder current and select “Hide Others” from the application menu. The application menu now looks like this:
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108. If I press Power now, nothing happens. That’s because PwrSwitcher normally leaves hidden applications hidden.
  109.  
  110. OK, that covers the basics of PwrSwitcher operation. The next section covers some advanced features.
  111.  
  112.  
  113.  
  114.  
  115. If that was all PwrSwitcher did, you’d probably have to establish certain work habits to make it useful. You should always remember that (as initially configured, although you can change this behavior using the control panel) PwrSwitcher only cycles through applications which have not been hidden by the Finder. You can take advantage of this when you find yourself switching among only a few of your active applications — simply hide the applications you’re not using at the moment, and let PwrSwitcher cycle through the ones you’re actively using.
  116.  
  117. PwrSwitcher can do other things. Let's go back to my example, and say I’m copying paragraphs from TeachText into MacDraw. Take a look back at the order in which I opened my applications: Finder, DarkSide, MPW Shell, MORE 3.0, THINK Pascal, TeachText, and MacDraw. If all my applications were visible, I would have to press Control–Power once to get from TeachText to MacDraw, and six times to get from MacDraw back to TeachText. Those six keypresses would drive me to distraction after a while…
  118.  
  119. Here’s Secret #1: PwrSwitcher cycles in reverse order when you press Shift–Power. This means that I can cycle from TeachText to MacDraw by pressing Power, and back to TeachText by pressing Shift–Power.
  120.  
  121. Life, however, is never as simple as examples in instruction manuals. Let’s say that I have the same list of visible applications as before, and want to switch back and forth between MORE 3.0 and TeachText. I can go foward in the cycle with two presses of Power, and backward (using Secret #1) with two presses of Shift–Power. After doing this a few times, I notice that I have to watch all the THINK Pascal windows redraw each time I want to go from MORE 3.0 to TeachText or vice versa. This annoys me…
  122.  
  123. That’s why we have Secret #2: PwrSwitcher “marks” an application when you press Shift–Option–Power. When you do this, the current application stays current. It looks like nothing happens. Behind the scenes, though, PwrSwitcher remembers the “marked” application.
  124.  
  125. By itself, Secret #2 is of little value. Even so, let’s say I just marked MORE 3.0, after which (using either PwrSwitcher or the application menu) I made TeachText the current application. Secret #3 completes the picture: When you press Option–Power, PwrSwitcher does something very special (and a bit more difficult to explain). The Option–Power combination “swaps” from an “alternate” application to the “marked” application (or vice versa).
  126.  
  127. What is the alternate application? It is the current application (IF OTHER THAN THE MARKED APPLICATION) at the time you press Option–Power. Let’s get back to my example: I’ve marked MORE 3.0 and made TeachText the current application. Now, when I press Option–Power, TeachText becomes the “alternate” and PwrSwitcher makes MORE 3.0 (the “marked” application) current. When I press Option–Power again, PwrSwitcher makes the “alternate” application current again. If you don’t understand this, read the last few paragraphs again — this is really useful once you get the hang!
  128.  
  129. Finally, here’s the scoop on the “auto-show” option. If “auto-show” is enabled, PwrSwitcher will switch to all applications, even the ones you’ve hidden.
  130.  
  131.  
  132.  
  133.  
  134. If you still have an alpha version (dated prior to September 26, 1991) of PwrSwitcher, you should be sure to remove it from your Extensions folder. The final version belongs in your Control Panels folder. To see the new icon, you may have to “rebuild your desktop” by holding down the ‘Option’ and ‘Command’ keys just before the Finder draws the desktop as your system starts up.
  135.  
  136. PwrSwitcher 1.0 and 1.1 both read some undocumented System 7.0 data structures to find out whether an application was hidden by the Finder. I got this information by working my way through the system MDEF, since it knows when to dim the icons in the application menu. Technically, this was a BAD THING to do — but I was very careful. I went to a lot of trouble to have PwrSwitcher do sanity checks every step of the way as it walked the undocumented data structures.
  137.  
  138. When System 7.1 changed these structures (as I was warned it would), PwrSwitcher 1.0 “forgot” how to skip over hidden applications; but did not cause any system crashes. If a future system changes these data structures again, the result should be the same — PwrSwitcher 1.1 will forget how to skip hidden applications, but should not crash.
  139.  
  140. I welcome your comments and suggestions. You can reach me on America Online as DBLamkins, or on the Internet as DBLamkins@aol.com.
  141.  
  142.  
  143.  
  144.  
  145. I owe a debt of gratitude to W. J. Bock for his system extension, Switch, which sparked the idea for PwrSwitcher. A big “thanks” goes to Hugues Marty and Michael Hecht (and their unnamed collaborators) for partially reverse-engineering an interface to the Layer Manager and posting it to CSMP.
  146.  
  147. I also want to thank the hundreds of AOL users who took a chance with the alpha versions of PwrSwitcher, and the smaller group of volunteer beta testers for the 1.1 release. PwrSwitcher has advanced to its present state thanks to the dozens of challenging and insightful comments from users. I may add more user–suggested enhancements in a future release.
  148.  
  149.  
  150.  
  151.  
  152. The name of this product is PwrSwitcher, not PowerSwitcher. I feel this is more distinctive, and less likely to be confused with a commercial product of a similar name.
  153.  
  154. PwrSwitcher is absolutely free. PwrSwitcher may be distributed so long as it includes this documentation. PwrSwitcher may not be sold. I retain all rights to PwrSwitcher. The user must assume all risk of loss resulting from use of PwrSwitcher.
  155.  
  156. Trademarks used herein are the property of their respective owners.
  157.  
  158.  
  159.  
  160.  
  161. Please skip this section if you’re not conversant with both ResEdit and Inside Macintosh. The following information is provided on a “if you can figure it out, feel free to use it” basis. I can not and will not provide help or support for the use of this information.
  162.  
  163. Some additional warnings: Firstly, please don’t distribute any modified copies of PwrSwitcher or this documentation. Secondly, I assume that you know how to use ResEdit and understand the usual precautions. Thirdly, I assume that you have access to Inside Macintosh to obtain the necessary keycode information.
  164.  
  165. PwrSwitcher loads the contents of its 'GLOB' resource during system startup. This resource describes which keys will activate PwrSwitcher, both for the “primary” keyset and the “alternate” keyset (as distributed, the power and esc keys, respectively).
  166.  
  167. If you use ResEdit or Resorcerer, you’ll be able to edit the 'GLOB' resource using the provided template. There are pairs of hex entries for each activation chord. Each pair consists of a mask followed by a comparison code.
  168.  
  169. To understand how the mask and comparison code are applied, you should look at the description of the ‘keycode’ parameter to the _KeyTrans trap in Inside Macintosh. For each pair in the active keyset (as determined by the checkbox in the PwrSwitcher control panel) the ‘keycode’ parameter is ANDed with the mask, then tested against the comparison code. If they match, the function named in the template is activated.
  170.  
  171. You should also update the contents of the STR# resources and the title of CNTL -4045 to reflect your new key names. The necessary changes will be obvious…
  172.  
  173. Note that the distributed keysets mask out the control key. PwrSwitcher tests internally for the presence of the control key if the “require control key” checkbox is enabled in the control panel. This test is not affected by masking out the control key in the 'GLOB' resource. Conversely, allowing the control key to pass through the mask does not affect the behavior of the “require control key” checkbox.
  174.  
  175. The remaining fields of the 'GLOB' resource provide the message that PwrSwitcher will pass to _DebugStr upon activation of the debugger chord, and provide initializers for globals (don’t mess with these).
  176.  
  177. Again, please don’t ask me for clarifications or help with this stuff; find a power user or wizard in your local users’ group if you can’t understand this section but think you need to use it.
  178.  
  179.  
  180.  
  181.  
  182. 1.0a1 — First public release.
  183. 1.0a2 — Added backwards cycle function. Ignored Control key to aid compatibility with RadiusWare Cursor Beacon.
  184. 1.0a3 — Added mark/swap functions. Added Finder help balloon.
  185. 1.0a4 — Added code to skip hidden layers. This version is designed not to load under System 7.1 or later (as a fail–safe for the hidden application detection code).
  186. 1.0a5 — Added color Finder icons. No longer confused as to the visibility of multiple copies of the same program. Changed the fail–safe mechanism so PwrSwitcher can continue to load under System 7.1 and later (although hidden application detection may not continue to work).
  187. 1.0b1 — Changed from extension to control panel. Added support for Macintosh Portable using ‘esc’ key as substitute for Power key. Rewrote documentation.
  188. 1.0b2 — Control panel now has preference controls and help balloons. Must use Control key with all key combinations. Known to fix “switch out problem” with Adobe Illustrator 3.0 (probably also fixes less severe problem with Microsoft Excel 3.0).
  189. 1.0 — [November 1991] Removed MacsBug names to save space. Bundled “NC” variant which doesn’t require use of Control key.
  190. 1.1b0 — [Not generally released] Found a better fix for the Illustrator and Excel glitches, without need for the Control key hack. Added a checkbox for those who actually got to like adding the Control key to the activation chords — this also means there’s no longer a separate ‘NC’ version. Added another checkbox to specify choice of power key or ‘esc’ key, rather than trying to decide based on keyboard Gestalt information. Fixed a crash that would occur if you pressed the power key after PwrSwitcher had loaded, but before the Finder had started.
  191. 1.1b1 — [Not generally released] Made many cosmetic changes to the control panel. Changed to use undocumented _LayerDispatch interface rather than walking the data structures I reverse-engineered in System 7.0 (since these changed in 7.1). Fixed a crash that happened if you opened and closed PwrSwitcher after booting with extensions disabled. Removed the “notify if can’t switch” feature. Added a “re-hide” feature.
  192. 1.1b2 [Never released] — Removed the _LayerDispatch calls and masked over the controls that rely on this. Until I figure out the appropriate selectors for _LayerDispatch, the “Auto-show hidden applications” and “Re-hide hidden apps on switch out” features will not be functional.
  193. 1.1b3 — [Not generally released] Restored the _LayerDispatch interface using new information. Suppressed activation when a modal dialog is the front window. Rearranged some internal code to improve reliability. Internally disabled the re-hide feature, and added some visual cues to indicate this non-feature. Fixed the problem where the ‘esc’ key (when selected as the activation key) was passed to the application during switching.
  194. 1.1b4 — [First public beta] Removed the non-functional re-hide control, and removed references from the documentation (except in this section).
  195. 1.1b5 — Found that the _LayerDispatch code in 1.1b4 had some rare but nasty side effects (layer mangling), so I tore it all out and went back to the visibility-test code I used in PwrSwitcher 1.0, with appropriate changes to handle both System 7.0 and System 7.1. With this change, I was able to get rid of all the compatibility warnings — you don’t have to worry about the “safety mode” documented with the 1.1b4 release.
  196. 1.1b6 — Added a screen saver check. Modal dialog check now ignores invisible windows. Added a _DebugStr call, accessible via shift-command-option-esc. Added a stack space check; PwrSwitcher won’t try to do anything if it gets called when _StackSpace returns less than 2K free. Changed the “GLOB” template to encourage ResEdit customization.
  197. 1.1b7 — Made the modal dialog check more reliable. False positives (causing PwrSwitcher to “stick” on certain applications) should be a thing of the past.
  198. 1.1 — Ignore state of “require controls” checkbox for debugger chord. Cut free stack check to 1K.
  199.  
  200.  
  201.  
  202.  
  203. Quite a few people have suggested that they’d be willing to pay for PwrSwitcher as a shareware product. I never planned to sell PwrSwitcher — I consider it a simple hack (well, it was simple once) — and am loath to take advantage of people’s good intentions.
  204.  
  205. If you want to make a contribution to express your appreciation of PwrSwitcher, please consider a charitable donation to Beverly Hospital, Beverly, MA 01915 (USA) in memory of Dr. Burnham E. Lamkins. The decision to do so is entirely at your discretion.